﻿using System;

namespace VerticalMenu.Utility
{
	public class Common
	{
		public static bool LessThan(double val1, double val2)
		{
			return val1 - val2 < -1E-09;
		}

		public static bool LessThan(double val1, double val2, double eps)
		{
			return val1 - val2 < -eps;
		}

		public static bool GreaterThan(double val1, double val2)
		{
			return val1 - val2 > 1E-09;
		}

		public static bool GreaterThan(double val1, double val2, double eps)
		{
			return val1 - val2 > eps;
		}

		public static bool IsEqual(double val1, double val2)
		{
			return !Common.LessThan(val1, val2) && !Common.LessThan(val2, val1);
		}

		public static bool IsEqual(double val1, double val2, double eps)
		{
			return !Common.LessThan(val1, val2, eps) && !Common.LessThan(val2, val1, eps);
		}

		public static bool Lessthan_Or_Equal(double val1, double val2)
		{
			return !Common.GreaterThan(val1, val2);
		}

		public static bool Lessthan_Or_Equal(double val1, double val2, double eps)
		{
			return !Common.GreaterThan(val1, val2, eps);
		}

		public static bool Greaterthan_Or_Equal(double val1, double val2)
		{
			return !Common.LessThan(val1, val2);
		}

		public static bool Greaterthan_Or_Equal(double val1, double val2, double eps)
		{
			return !Common.LessThan(val1, val2, eps);
		}

		public const double _epsDouble = 1E-09;

		public const double _epsPoint = 0.0001;

		public const double _epsAngle = 0.0001;
	}
}
